﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Web.Mail;

namespace Microserve.TeleEye.Web
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnOk_Click(object sender, EventArgs e)
        {
          
        
        System.Net.Mail.MailMessage m = new System.Net.Mail.MailMessage();
        m.Body = "Hi";
        m.IsBodyHtml = false;
        m.To.Add(this.txtEmail.Text);
        m.From = new System.Net.Mail.MailAddress("contact@teleeye.com.ph");
        m.Subject = "hi";
        m.Headers.Add("Reply-To", "contact@teleeye.com.ph");

        System.Net.NetworkCredential c = new System.Net.NetworkCredential();
        c.Password = "Erwin#(@&";
        c.UserName = "lee.erwin@gmail.com";
        System.Net.Mail.SmtpClient s = new System.Net.Mail.SmtpClient();
        s.UseDefaultCredentials = false;
        s.Credentials = c;
        s.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
        s.EnableSsl = true;
        s.Port = 587;
        s.Host = "smtp.gmail.com";
        
        s.Send(m);
        }
    }
}